
import java.util.Scanner;

class BIT {

    public static void main(String[] args) {
        Scanner entrada = new Scanner(System.in);
        int V = entrada.nextInt();
        int n = 1;
        
        while (V > 0) {
            int I = 0, J = 0, K = 0, L = 0;
            if (V >= 50) {
                I = V / 50;
                V = V % 50;
            }
            if (V >= 10) {
                J = V / 10;
                V = V % 10;
            }
            if (V >= 5) {
                K = V / 5;
                V = V % 5;
            }
            if (V >= 1) {
                L = V / 1;
            }
            System.out.println("Teste " + n);
            System.out.println(I + " " + J + " " + K + " " + L);
            System.out.println();
            n++;
            V = entrada.nextInt();
        }
    }

}
